<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Nabu-asr: Computing</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Nabu-asr
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Computing </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Nabu has several computing modes. If you train or test a model, you will use one of these modes to do the computation. You can choose the computation mode by poining to a configuration file in config/computing in your scripts. Some of these computing modes are distributed computing modes. For distributed computing modes you can use multiple devices in parallel. For these modes there are 2 kinds of jobs: 1) A parameter server job simply holds the parameters of your model and shares them wit the other devices. Multiple parameter servers are possible, in this case the parameters will be devide among the servers. A parameter will normally run on CPU. 2) A worker job reads parameters from the parameter server, does the actual computation and submits gradients back to the parameter server to update the parameters. Multiple workers can work in parallel. A worker job normally runs on a GPU.</p>
<h2>Standart</h2>
<p>The standart computing modes do not use a distributed comuting system (Like HTCondor or Kubernetes) but rely on the user to determine on what machines they want to run the scripts.</p>
<h3>Non Distributed</h3>
<p>The non distributed mode will run on a single device. This is the simplest mode of computation. you can choose this mode py pointing to config/computing/standart/non_distributed.cfg. The script will run on the device its called from.</p>
<h3>Single Machine</h3>
<p>The Single machine mode will run on multiple devices within a single machine. you can choose this mode py pointing to config/computing/standart/single_machine.cfg. In the configuration you can choose the amount of parameter servers and workers. It is advised that the amount of workers does not exceed the number of GPUs in the machine. The script will run on the device its called from.</p>
<h3>Multi Machine</h3>
<p>The Multi machine mode will run on multiple devices that do not need to be in the same machine. To run this mode you should first create a cluster file. In the cluster file there should be one line per job. This line contains the type of job (ps or worker), the adress of the machine, a network port for communication and a GPU this job should run on (may be empty). An example cluster file for 2 parameter servers and 3 workers is:</p>
<div class="fragment"><div class="line">ps,ps1.example.com,1024,</div><div class="line">ps,ps2.example.com,1024,</div><div class="line">worker,worker1.example.com,1024,0</div><div class="line">worker,worker1.example.com,1025,1</div><div class="line">worker,worker2.example.com,1024,0</div></div><!-- fragment --><p>You can the use this mode by pointing to config/computing/standart/multi_machine.cfg. In this config you should point to the cluster file you created.</p>
<h2>Condor</h2>
<p>The Condor compute modes use <a href="https://research.cs.wisc.edu/htcondor/">HTCondor</a> to select the machines to run the scripts on instead of relying on the user to do this. The same computing modes are possible with Condor as he standar compute modes. The configurations can be found in config/computing/condor. Before you can start using condor you should create the create_environment.sh script in the nabu/computing/condor/ directory. This file should create the necesarry environment variables (like PYTHONPATH) and then execute its arguments. An example script:</p>
<div class="fragment"><div class="line">#!/bin/sh</div><div class="line"></div><div class="line">#create the necesary environment variables</div><div class="line">export PYTHONPATH=/path/to/python/libs</div><div class="line"></div><div class="line">#execute arguments</div><div class="line">$@</div></div><!-- fragment --> </div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
